@echo off
set x=%cd%
echo Building %x%.xpi ...
echo Started at %DATE% %TIME% > %x%\build.log
md build\chrome
cd chrome
zip  -r -0 "%x%.jar" * >> %x%\build.log
move "%x%.jar" ..\build\chrome >> %x%\build.log
cd ..
copy install.rdf build >> %x%\build.log
copy chrome.manifest build >>%x%\build.log
xcopy components build\components /c /i /s
xcopy defaults build\defaults /c /i /s
rem signtool.exe -d C:\Projects\CodeSigning -k "Code Signing (Certum)" -p "password" build/ >> %x%\build.log
cd build
rem SIGN! zip "%x%.xpi" META-INF/zigbert.rsa >> %x%\build.log
rem SIGN! zip -r -D "%x%.xpi" * -x META-INF/zigbert.rsa >> %x%\build.log
zip -r -D "%x%.xpi" * >> %x%\build.log
rem SIGN! rem copy "%x%.xpi" ..\..\..\http\fsb.xpi >> %x%\build.log
move "%x%.xpi" ..\ >> %x%\build.log
cd ..
rd build /s/q
echo Done.
